package com.fancy.controller;

import com.fancy.pojo.BaseResult;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

import java.io.IOException;

@ControllerAdvice
@ResponseBody
public class ExceptionController {

    @ExceptionHandler(value = IOException.class)
    public BaseResult ioException(){
        BaseResult baseResult = new BaseResult();
        baseResult.setMessage("网络不佳");
        return baseResult;

    }
}
